/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.regressao.linear.dao;

import br.com.regressao.linear.modelo.EixoX;
import br.com.regressao.linear.modelo.IModelo;
import br.com.regressao.linear.modelo.ItemEixoX;
import java.util.List;

/**
 * @author Rodrigo Moreira Alexandre
 * @author Fernando Aparecido Paulo
 */
public class DAOEixoX extends DAOGenerico {

    @Override
    public EixoX consultar(int codigo) {
        return (EixoX) super.consultar(EixoX.class, codigo, false);
    }

    @Override
    public <T extends IModelo> T consultar(int codigo, boolean comInativo) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public <T extends IModelo> T consultarCodigo(String codigo, boolean comInativo) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public <T extends IModelo> List<T> getLista() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    public Integer getMaxEixoX() {
        try {
            abrirSessao();
            getSession().beginTransaction();
            Integer cod = (Integer) session.getNamedQuery("EixoX.getMax").uniqueResult();
            getSession().getTransaction().commit();
            return cod;
        } catch (RuntimeException ex) {
            getSession().getTransaction().rollback();
            throw ex;
        }
    }
}
